/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f7f8fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  padding-bottom: 60px; /* 为底部导航栏留出空间 */
}

/* Tab Bar Container */
.tab-bar-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-top: 1px solid #ebedf0;
}

/* Home Page Styles */
.home-page {
  background: #f7f8fa;
  min-height: 100vh;
  /* 确保sticky定位在iOS Safari中正常工作 */
  -webkit-overflow-scrolling: touch;
}

/* Top Header */
.top-header {
  background: #1989fa;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logo-container:hover {
  transform: scale(1.02);
}

.logo-container:hover .logo-icon {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: rotate(5deg);
}

.logo-container:hover .medical-icon {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.medical-icon {
  width: 24px;
  height: 24px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dot {
  font-size: 1.2rem;
  opacity: 0.8;
  font-weight: 300;
}

.sub-name {
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.header-right {
  display: flex;
  gap: 1rem;
}

.header-right .icon {
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.9;
}

/* Search Section */
.search-section {
  padding: 1rem 1.5rem;
  background: white;
  position: relative;
  z-index: 999;
}

.search-bar {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #ebedf0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.search-bar:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

.search-bar:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-icon {
  margin-right: 0.75rem;
  font-size: 1.2rem;
  color: #999;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #333;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.search-input:read-only {
  cursor: pointer;
}

.search-input::placeholder {
  color: #999;
}

/* Hotline Info */
.hotline-info {
  background: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  overflow: hidden;
}

.speaker-icon {
  color: #ff6b35;
  font-size: 1rem;
  flex-shrink: 0;
}

.hotline-scroll-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.hotline-scroll-content {
  display: flex;
  animation: scroll-hotline 30s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

.hotline-scroll-content:hover {
  animation-play-state: paused;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .hotline-scroll-content {
    animation-duration: 25s;
  }
}

.hotline-text {
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
  margin-right: 2rem;
}

@keyframes scroll-hotline {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Quick Features */
.quick-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: white;
}

.feature-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.feature-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.feature-icon.consultation {
  position: relative;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.fast-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4d4f;
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: bold;
}



.feature-card h3 {
  color: #333;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.feature-card p {
  color: #666;
  margin: 0;
  font-size: 0.8rem;
}

/* Expert Section */
.expert-section {
  background: white;
  margin-top: 1rem;
  padding: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  color: #333;
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.more-link {
  color: #1989fa;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Department Tabs */
.department-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.dept-tab {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  color: #666;
  border-radius: 20px;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dept-tab.active {
  background: #1989fa;
  color: white;
}

.dept-tab:hover {
  background: #e6f7ff;
  color: #1989fa;
}

.dept-tab.active:hover {
  background: #1677ff;
  color: white;
}

/* Current Department Info */
.current-department {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #1989fa;
}

.dept-title {
  color: #333;
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.dept-desc {
  color: #666;
  margin: 0;
  font-size: 0.9rem;
}

/* No Doctors State */
.no-doctors {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}

.no-doctors p {
  margin: 0;
  font-size: 1rem;
}

/* Doctors List */
.doctors-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 医生卡片样式 */
.doctor-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  gap: 16px;
}

.doctor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 医生头像区域 */
.doctor-avatar {
  position: relative;
  flex-shrink: 0;
}

.doctor-avatar .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e8f4fd;
}

.doctor-avatar .status-info {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.doctor-avatar .status {
  background: #52c41a;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.doctor-avatar .status.online {
  background: #52c41a;
}

.doctor-avatar .status.grade {
  background: #fa8c16;
}

/* 医生信息区域 */
.doctor-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

/* 医生头部信息 */
.doctor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.doctor-header .doctor-name {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.2;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.doctor-header .doctor-title {
  font-size: 14px;
  color: #666;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 12px;
  margin-right: 8px;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.doctor-header .hospital-grade {
  background: #52c41a;
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* 医院信息 */
.hospital {
  font-size: 13px;
  color: #999;
  margin: 0 0 12px 0;
  line-height: 1.4;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 咨询类型 */
.consultation-types {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.consultation-btn {
  background: #1890ff;
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.consultation-btn:nth-child(2) {
  background: #52c41a;
}

.consultation-btn:nth-child(3) {
  background: #fa8c16;
}

.consultation-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* 专长描述 */
.specialty {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 16px 0;
  position: relative;
  padding-right: 24px;
  /* 多行文字溢出隐藏 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 2.8em;
}

.specialty .expand-icon {
  position: absolute;
  right: 0;
  top: 0;
  color: #999;
  font-size: 16px;
  cursor: pointer;
}

/* 统计数据 */
.doctor-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
}

.doctor-stats .divider {
  color: #ddd;
  font-weight: 300;
}

.doctor-stats .highlight {
  color: #fa8c16;
  font-weight: 600;
  margin-left: 4px;
}

/* 统计数据项 */
.doctor-stats span {
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* 底部操作区 */
.doctor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 12px;
}

.doctor-footer .action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.doctor-footer .follow-btn {
  background: #f0f0f0;
  color: #666;
  border: 1px solid #d9d9d9;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  justify-content: center;
}

.doctor-footer .follow-btn:hover {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #1890ff;
}

.doctor-footer .follow-btn.followed {
  background: #f6ffed;
  border-color: #b7eb8f;
  color: #52c41a;
}

.doctor-footer .follow-btn .follow-icon {
  font-size: 14px;
  font-weight: bold;
}

.doctor-footer .price {
  font-size: 18px;
  font-weight: 700;
  color: #ff6b35;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.doctor-footer .price-unit {
  font-size: 14px;
  font-weight: 400;
  color: #999;
  margin-left: 2px;
}

.doctor-footer .ask-doctor-btn {
  background: #1890ff;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 80px;
  /* 单行文字溢出隐藏 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doctor-footer .ask-doctor-btn:hover {
  background: #096dd9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.doctor-footer .ask-doctor-btn:active {
  transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .logo-container {
    gap: 0.5rem;
  }
  
  .logo-icon {
    width: 36px;
    height: 36px;
  }
  
  .medical-icon {
    width: 20px;
    height: 20px;
  }
  
  .app-name {
    font-size: 1.1rem;
  }
  
  .sub-name {
    font-size: 0.85rem;
  }
  
  .doctor-card {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .doctor-avatar .avatar {
    width: 60px;
    height: 60px;
  }
  
  .doctor-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .doctor-header .doctor-name {
    max-width: 100%;
  }
  
  .consultation-types {
    gap: 6px;
  }
  
  .consultation-btn {
    padding: 3px 10px;
    font-size: 11px;
    max-width: 80px;
  }
  
  .doctor-stats {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .doctor-stats span {
    max-width: 100px;
  }
  
  .specialty {
    -webkit-line-clamp: 3;
    max-height: 4.2em;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .logo-container {
    gap: 0.4rem;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
  }
  
  .medical-icon {
    width: 18px;
    height: 18px;
  }
  
  .app-name {
    font-size: 1rem;
  }
  
  .sub-name {
    font-size: 0.8rem;
  }
  
  .doctor-header .doctor-name {
    font-size: 18px;
  }
  
  .doctor-header .doctor-title {
    font-size: 12px;
    max-width: 100px;
  }
  
  .consultation-btn {
    max-width: 70px;
    font-size: 10px;
    padding: 2px 8px;
  }
  
  .specialty {
    font-size: 13px;
    -webkit-line-clamp: 2;
    max-height: 2.6em;
  }
  
  .doctor-footer .price {
    font-size: 16px;
    max-width: 80px;
  }
  
  .doctor-footer .ask-doctor-btn {
    padding: 8px 20px;
    font-size: 13px;
    min-width: 70px;
  }
}

/* Smooth transitions */
* {
  transition: all 0.2s ease;
}

/* Custom scrollbar */
.app-main::-webkit-scrollbar {
  width: 6px;
}

.app-main::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.app-main::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.app-main::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 滚动时的头部栏效果 */
.top-header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: rgba(25, 137, 250, 0.95);
}

/* 确保在移动端滚动时的效果 */
@media (max-width: 768px) {
  .top-header.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

/* 加载状态样式 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #666;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1989fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 错误状态样式 */
.error-state {
  text-align: center;
  padding: 2rem 1rem;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 8px;
  margin: 1rem 0;
  color: #ff4d4f;
}

.error-state p {
  margin: 0;
  font-size: 14px;
}

/* 加载更多样式 */
.loading-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: #666;
}

.loading-more .loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1989fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

/* 没有更多数据样式 */
.no-more-data {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
  font-size: 14px;
}

.no-more-data p {
  margin: 0;
}

/* 医生列表滚动容器 */
.doctors-list {
  max-height: 600px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* 自定义滚动条 */
.doctors-list::-webkit-scrollbar {
  width: 6px;
}

.doctors-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.doctors-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.doctors-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
